﻿@import "variables.less";
@import "mixins.less";
//
// 表单
//
input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
}

.form-inline {
    .clearfix;
    >.form-group {
        display: inline-block;
        vertical-align: middle;
        padding: @form-group-padding 0 0 @form-group-padding;
        >input[type="text"],
        >select {
            display: inline-block;
            vertical-align: middle;
            width: 150px;
        }
        >input[type="search"] {
            margin-right: 20px;
            width: 280px;
            @media screen and (min-width: 0) and (max-width:@screen-md-max) {
                width: 240px;
            }
        }
        &:first-child {
            padding: @form-group-padding 0 0 0;
        }
        >.btn {
            margin: 0 20px 0 0;
        }
        >input+button {
            margin-left: 5px;
        }
        >.form-label+select,
        >.form-label+input {
            margin-left: 1em;
        }
        >.progress {
            width: 150px;
        }
        >.milestone {
            display: inline-block;
        }
    }
    &+.table,
    &+.list-group {
        margin-top: 20px;
    }
}

.form-group {
    padding: @form-group-padding 0 0 0;
    .clearfix;
    >img {
        .icon(24px, 0 5px);
    }
    >.btn {
        margin: 0 20px 0 0;
        >img {
            .icon(24px, 0 5px 0 0);
        }
    }
    >.btn:last-child {
        margin: 0;
    }
}

.form-label {
    display: inline-block;
    padding: @form-label-padding;
    color: @form-label-color;
}

.form-control {
    display: block;
    width: 100%;
    height: @form-control-height;
    padding: @form-control-padding;
    border: @form-control-border;
    color: @form-control-color;
    background-color: @form-control-bg;
    background-image: none;
    &:focus {
        border-color: @form-control-focus-border-color;
        .focus(@form-control-focus-border-color);
    }
    &[disabled],
    &[readonly],
    fieldset[disabled] & {
        background-color: @form-control-disabled-bg;
    }
    &[disabled],
    fieldset[disabled] & {
        cursor: not-allowed;
    }
    textarea& {
        height: auto;
    }
}

.form-help-block {
    display: block;
    margin-top: 5px;
    margin-bottom: 10px;
    color: @form-help-block-color;
    font-size: @form-help-blokc-font-size;
}

.form-success {
    .form-control-validation(@form-success-border-color, @form-success-color, @form-success-bg);
}

.form-warning {
    .form-control-validation(@form-warning-border-color, @form-warning-color, @form-warning-bg);
}

.form-error {
    .form-control-validation(@form-error-border-color, @form-error-color, @form-error-bg);
}